﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Layout.Master" AutoEventWireup="true" CodeBehind="wfSMSMonthly.aspx.cs" Inherits="Dragon.wfSMSMonthly" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">    
    <table class="auto-style9" style="border-color: #666633">        
        <tr>
            <td class="auto-style8">Từngày</td>
            <td class="auto-style7">
                <asp:TextBox ID="txtFromDate" runat="server" Width="100px">01/06/2015</asp:TextBox>
                <cc1:CalendarExtender ID="txtFromDate_CalendarExtender" runat="server" BehaviorID="txtFromDate_CalendarExtender" TargetControlID="txtFromDate" Format="dd/MM/yyyy" />
            </td>
            <td class="auto-style5">Tỉnh thành</td>
            <td class="auto-style17">
                <cc1:ComboBox ID="ddlProvince" runat="server" DataSourceID="SqlDataSource2" DataTextField="Name" DataValueField="Code" DropDownStyle="DropDownList" MaxLength="0" style="display: inline; text-align: left;" Width="150px" OnDataBound="ProvinceOnDataBound" AutoPostBack="True">
                </cc1:ComboBox>
            </td>
            <td class="auto-style16">
                Loại tin nhắn</td>
            <td class="auto-style11">
                <cc1:ComboBox ID="ddlSMSType" runat="server" DataTextField="Name" DataValueField="Code" DropDownStyle="DropDownList" MaxLength="0" style="display: inline; text-align: left;" Width="150px" OnDataBound="BASOnDataBound">
                    <asp:ListItem>Tất cả</asp:ListItem>
                    <asp:ListItem Selected="True">Đã được duyệt</asp:ListItem>
                </cc1:ComboBox>
            </td>
            <td class="auto-style11">
                Loại sản phẩm</td>
            <td class="auto-style15">
                <cc1:ComboBox ID="ddlSKUType" runat="server" DataTextField="Name" DataValueField="Code" DropDownStyle="DropDownList" MaxLength="0" style="display: inline; text-align: left;" Width="150px" OnDataBound="BASOnDataBound">
                    <asp:ListItem Selected="True">Lon/Chai</asp:ListItem>
                    <asp:ListItem>Két/Thùng</asp:ListItem>
                </cc1:ComboBox>
                </td>
            <tr>
            <td class="auto-style8">Đến ngày</td>
            <td class="auto-style7">
                <asp:TextBox ID="txtToDate" runat="server" Width="100px">30/06/2015</asp:TextBox>
                <cc1:CalendarExtender ID="txtToDate_CalendarExtender" runat="server" BehaviorID="txtToDate_CalendarExtender" TargetControlID="txtToDate" Format="dd/MM/yyyy" />
            </td>
            <td class="auto-style5">Tổ trưởng</td>
            <td class="auto-style17">
                <cc1:ComboBox ID="ddlBAS" runat="server" DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="Code" DropDownStyle="DropDownList" MaxLength="0" style="display: inline; text-align: left;" Width="150px" OnDataBound="BASOnDataBound">
                </cc1:ComboBox>
            </td>
            <td class="auto-style16">
                &nbsp;</td>
            <td class="auto-style11">
                &nbsp;</td>
            <td class="auto-style11">
                &nbsp;</td>
            <td class="auto-style15">
                &nbsp;</td>
            <tr>
            <td class="auto-style6" colspan="8">
                <asp:Button ID="btnRunReport" runat="server" style="text-align: center" Text="Xem báo cáo" OnClick="btnRunReport_Click" />
            </td>
        </tr>
        <tr>
            <td class="auto-style4" colspan="8">                
                <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" 
                    WaitMessageFont-Size="14pt" Width="100%" Height="530px">
                    <LocalReport ReportPath="Report\rpSMSMonthly.rdlc">
                        <DataSources>
                            <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="dsSMSMonthly" />
                        </DataSources>
                    </LocalReport>
                </rsweb:ReportViewer>
            </td>
        </tr>
    </table>  
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CarlsbergConnectionString %>" SelectCommand="SELECT * FROM [BAS] WHERE ([Province] = @Province)">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlProvince" Name="Province" PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>

    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="Dragon.Dataset.dsSMSMonthlyTableAdapters.ReportSMSMonthlyTableAdapter" InsertMethod="Insert">
        <InsertParameters>
            <asp:Parameter Name="BASCode" Type="String" />
            <asp:Parameter Name="BASName" Type="String" />
            <asp:Parameter Name="BACode" Type="Int32" />
            <asp:Parameter Name="BACodeNS" Type="String" />
            <asp:Parameter Name="BAName" Type="String" />
            <asp:Parameter Name="BAPhone" Type="String" />
            <asp:Parameter Name="CustomerSMSCode" Type="String" />
            <asp:Parameter Name="CustomerDragonCode" Type="String" />
            <asp:Parameter Name="CustomerName" Type="String" />
            <asp:Parameter Name="CustomerAddress" Type="String" />
            <asp:Parameter Name="CVTCSR" Type="String" />
            <asp:Parameter Name="NoOfDay" Type="Int32" />
            <asp:Parameter Name="CB" Type="Int32" />
            <asp:Parameter Name="CC" Type="Int32" />
            <asp:Parameter Name="CD" Type="Int32" />
            <asp:Parameter Name="D4" Type="Int32" />
            <asp:Parameter Name="DC" Type="Int32" />
            <asp:Parameter Name="GB" Type="Int32" />
            <asp:Parameter Name="GC" Type="Int32" />
            <asp:Parameter Name="H3" Type="Int32" />
            <asp:Parameter Name="H4" Type="Int32" />
            <asp:Parameter Name="HC" Type="Int32" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:CarlsbergConnectionString %>" SelectCommand="SELECT * FROM [Province] WHERE ([Status] = @Status)">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="Status" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

    </asp:Content>
